package com.cmc.cloud.cmclink.doc.convert;

import com.cmc.cloud.cmclink.bdt.api.base.dto.resp.VesselNameDataRespDTO;
import com.cmc.cloud.cmclink.doc.entity.ApprovePermissionConfigDO;
import com.cmc.cloud.cmclink.doc.rpcservice.vo.VesselNameBaseVo;
import com.cmc.cloud.cmclink.doc.vo.special.approvepermissionvo.ApprovePermissionConfigRespVO;
import com.cmc.cloud.cmclink.doc.vo.special.approvepermissionvo.ApprovePermissionConfigUserRespVO;
import org.mapstruct.Context;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 用户船舶审批权限配置 Convert
 *
 * @author 集运管理员
 */
@Mapper
public interface ApprovePermissionConfigConvert {

    ApprovePermissionConfigConvert INSTANCE = Mappers.getMapper(ApprovePermissionConfigConvert.class);

    /**
     * 属性转换 convert
     *
     * @param list
     * @return
     */
    List<ApprovePermissionConfigRespVO> convertVesselList(List<VesselNameDataRespDTO> list);

    /**
     * 属性转换 convert
     *
     * @param list
     * @param userId
     * @return
     */
    @Mapping(target = "userId", ignore = true)
    List<ApprovePermissionConfigDO> convertDOList(List<VesselNameBaseVo> list, @Context Long userId);

    /**
     * 属性转换 convert
     *
     * @param configDO
     * @return
     */
    ApprovePermissionConfigUserRespVO convert(ApprovePermissionConfigDO configDO);
}
